<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>后台用户管理</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">
    <link rel="shortcut icon" href="favicon.ico">
    <link href="__ADMIN__css/bootstrap.min.css" rel="stylesheet">
    <link href="__ADMIN__css/font-awesome.min.css" rel="stylesheet">
    <link href="__ADMIN__css/animate.css" rel="stylesheet">
    <link href="__ADMIN__css/style.css" rel="stylesheet">
    <link href="__ADMIN__js/plugins/layer/skin/default/layer.css" rel="stylesheet">
    <link href="__ADMIN__js/plugins/layer/laypage/skin/laypage.css" rel="stylesheet">
    <link rel="stylesheet" href="__ADMIN__css/plugins/switchery/switchery.css" />
    <link href="__ADMIN__css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
</head>
<body>
<div class="col-sm-12">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>广告管理</h5>
            <div class="ibox-tools">
            </div>
        </div>
        <div class="ibox-content">
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>广告标题</th>
                    <th>所属版位</th>
                    <th>状态</th>
                    <th>点击数</th>
                    <th>添加时间</th>
                    <th>排序</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody id="tbody">
                    <volist name="list" id="vo">
                        <tr>
                            <td>{$vo.id}</td>
                            <td>{$vo.name}</td>
                            <td>{$vo.spacename}</td>
                            <td>
                                <if condition="($vo.disabled eq 1)">
                                    <a href="javascript:changeMode({$vo.id})" id="mode{$vo.id}" class="btn btn-info btn-outline">正常</a>
                                    <else />
                                    <a href="javascript:changeMode({$vo.id})" id="mode{$vo.id}" class="btn btn-warning btn-outline">禁用</a>
                                </if>
                            </td>
                            <td>{$vo.hits}</td>
                            <td>{$vo.addtime|date='Y-m-d H:i:s',###}</td>
                            <td>{$vo.listorder}</td>
                            <td>
                                <a href="{:U('poster/edit?id='.$vo['id'])}" type="button" class="btn btn-outline btn-info"><i class="fa fa-pencil-square-o"></i>修改</a>
                                <a href="javascript:Del({$vo.id})" class="btn btn-outline btn-danger"><i class="fa fa-trash-o"></i>删除</a>
                            </td>
                        </tr>
                    </volist>
                </tbody>
            </table>
        </div>
    </div>
</div>
<script src="__ADMIN__js/jquery.min.js"></script>
<script src="__ADMIN__js/bootstrap.min.js"></script>
<script src="__ADMIN__js/plugins/layer/layer.js"></script>
<script src="__ADMIN__js/plugins/layer/laypage/laypage.js"></script>
<script src="__ADMIN__js/plugins/switchery/switchery.js"></script>
<script src="__ADMIN__js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="__ADMIN__js/comment.js"></script>
</body>
<script>
function changeMode(id){
    var mode = $("#mode" + id);
    common.status("{:U('poster/changeMode')}",id,mode);
}
function Del(id){
    swal({
        title: "您确定要删除吗？",
        text: "",
        type: "warning",
        showCancelButton: true,
        closeOnConfirm: false,
        confirmButtonText: "删除",
        confirmButtonColor: "#ec6c62",
        cancelButtonText: "取消"
    }, function() {
        $.post("{:U('Poster/del')}",{id:id},function(data){
            if(data.status > 0){
                swal({title: "OMG",text: data.msg,type: "error"}, function() { window.location.reload();
                });
            }else{
                swal({title: "Good",text: data.msg,type: "success"}, function() { window.location.reload();
                })
            }
        });
    })
}
</script>
</html>
